#include <iostream>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include "bitelog.h"

DEFINE_bool(async, false, "是否启用异步日志");
DEFINE_int32(level, 1, "输出日志等级");
DEFINE_string(format, "[%H:%M:%S][%-7l]: %v", "日志输出格式");
DEFINE_string(path, "stdout", "日志输出目标");

TEST(log_test, test) {
    // 设置日志器参数
    bitelog::log_settings settings = {
        .async = FLAGS_async,
        .level = FLAGS_level,
        .format = FLAGS_format,
        .path = FLAGS_path
    };
    // 初始化日志器
    bitelog::bitelog_init(settings);
    // 打印日志
    DBG("{}今年{}岁", "⼩明", 18);
    INF("{}今年{}岁", "⼩红", 19);
    WRN("{}今年{}岁", "⼩刚", 20);
    ERR("{}今年{}岁", "⼩李", 21);
    DBG("HELLO");
}

int main(int argc, char* argv[]) {
    google::ParseCommandLineFlags(&argc, &argv, true);
    testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}